<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>JSON数据解析</title>
</head>

<body>
  <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js" type="application/javascript"></script>
  <script>
    $.ajax({
      type: 'get',
      url: 'https://m.maizuo.com/gateway?cityId=320500&pageNum=1&pageSize=30&type=1&k=2069287',
      beforeSend(xhr) {
        xhr.setRequestHeader("X-Host", "mall.film-ticket.film.list")
      },
      success(result, status, xhr) {
        console.log(result)

        //打印所有的国产电影
        console.log(result.data.films.filter(film => film.nation == '中国大陆'));

        //打印于和伟参演的电影
        console.log(result.data.films.filter(film => film.actors.includes(film.actors.find(actor => actor.name == '于和伟'))))
      }
    })
  </script>
</body>

</html>